T(n) = 2T(n/2) + 1
T(1) = 1

=> T(n) is O(n log2(n))

ToH:

ToH(n, start, end, temp):
	if n == 0  return
	
	ToH(n-1, start, temp, end)
	moveOneDisk(start, end)
	ToH(n-1, temp, end, start)

Denote by T(n) the running time when there are n disks

Case study: merge sort (recursive)
Time complexity: O(n log2(n))
Space complexity: O(n)

- Example#1: Merge sort (Algoexpert)
Running time: 
T(n) = 2T(n/2) + n
T(1) = 1

=> T(n) is O(n log2(n))

- Please watch Google Deep mind documentary about the AlphaGo software (Reinforcement Learning)

- Stack
It is a Last In First Out 
The accessible element is called the top of the stack
Vocabulary: Insert <=> push and Removal <=> pop

1	2	3

Stack-based reversal of the elements of an array
3 	2 	1

3
2
1

Java does offer a Stack class ---> in java.util

Example#2: Secret Message App

The message was encoded by reversing the characters of every word

Example#3: Grouping symbol matching

() ---> Valid
(] ---> Invalid

([)] ---> Invalid

Use a stack to determine whether the grouping symbols in an input expression match up correctly

[( a + b )]


Stack:

Objective 1: Show you how to build a stack from scratch. 
Objective 2: Use our stack to solve the grouping symbols problem

Store the elements of the stack in an array
top: index of the top element (initial value = -1)





























